home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASWIZ20 / JOYSTICK.PAS < prev    next >
Pascal/Delphi Source File  |  1994-11-04  |  2KB  |  67 lines

  1. {   +----------------------------------------------------------------------+
  2.     |                                                                      |
  3.     |        PasWiz  Copyright (c) 1990-1994  Thomas G. Hanlin III         |
  4.     |                                                                      |
  5.     +----------------------------------------------------------------------+
  6.  
  7.  
  8.  
  9. Joystick:
  10.  
  11.    This unit provides joystick support via the BIOS routines. It will work on
  12.    all but the oldest machines. Joystick support was added to the BIOS around
  13.    the time of the ATs, circa 1985.
  14.  
  15. }
  16.  
  17.  
  18.  
  19. UNIT Joystick;
  20.  
  21.  
  22.  
  23. INTERFACE
  24.  
  25.  
  26.  
  27. FUNCTION ButtonA1: Boolean;
  28. FUNCTION ButtonA2: Boolean;
  29. FUNCTION ButtonB1: Boolean;
  30. FUNCTION ButtonB2: Boolean;
  31.  
  32. PROCEDURE Buttons(VAR A1, A2, B1, B2: Boolean);
  33. PROCEDURE Positions(VAR AX, AY, BX, BY: WORD);
  34.  
  35.  
  36.  
  37. { --------------------------------------------------------------------------- }
  38.  
  39.  
  40.  
  41. IMPLEMENTATION
  42.  
  43.  
  44.  
  45. {$F+}
  46.  
  47. { the below routines are in assembly language }
  48.  
  49.  
  50.  
  51. FUNCTION ButtonA1; external;      { whether joystick A, button 1 is pressed }
  52. FUNCTION ButtonA2; external;      { whether joystick A, button 2 is pressed }
  53. FUNCTION ButtonB1; external;      { whether joystick B, button 1 is pressed }
  54. FUNCTION ButtonB2; external;      { whether joystick B, button 2 is pressed }
  55.  
  56. PROCEDURE Buttons(VAR A1, A2, B1, B2: Boolean); external;  { all buttons }
  57. PROCEDURE Positions(VAR AX, AY, BX, BY: WORD); external;   { stick positions }
  58.  
  59.  
  60. {$L JOYSTK}
  61.  
  62.  
  63.  
  64. { ----------------------- initialization code --------------------------- }
  65. BEGIN
  66. END.
  67.